public class Statistic {
    private int quantityOfVictims;
    private int quantityOfPredators;

    public Statistic(AllCreatures allCreatures) {
        quantityOfPredators = countPredators(allCreatures);
        quantityOfVictims = countVictims(allCreatures);
    }

    public int countVictims(AllCreatures allCreatures) {
        int quantity = 0;
        for (Fish fish : allCreatures) {
            if (fish.getType() == CreaturesType.Victim) {
                quantity++;
            }
        }
       return quantity;
    }

    public int countPredators(AllCreatures allCreatures) {
        int quantity = 0;
        for (Fish fish : allCreatures) {
            if (fish.getType() == CreaturesType.Predator) {
                quantity++;
            }
        }
        return quantity;
    }

    public String toString() {
        return String.format("There are %d victims and %d predators", quantityOfVictims, quantityOfPredators);
    }
}
